package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.AlertRule;
import com.zzyl.vo.AlertRuleVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AlarmRuleMapper {
    void create(AlertRule alertRule);

    Page<AlertRuleVo> getPage(String alertRuleName, String functionName, String productKey);

    @Select("select * from alert_rule where id=#{id}")
    AlertRuleVo read(Integer id);

    void update( AlertRule alertRule);

    @Delete("delete from alert_rule where id=#{id}")
    void delete(Integer id);

    @Update("update alert_rule set status =#{status} where id=#{id}")
    void updateStatus(Long id, Integer status);

    List<AlertRule> queryAlarm(@Param("productKey") String productKey,
                               @Param("iotId") String iotId,
                               @Param("functionId") String functionId);
}
